﻿using System.Data;
using System.Data.SQLite;
using System.Web;

namespace WebApplication1.DL
{
    public class db
    {
        protected SQLiteConnection sql_con;
        protected SQLiteCommand sql_cmd;
        protected SQLiteDataAdapter DB;
        protected DataSet ds = new DataSet();
        protected DataTable dt = new DataTable();

        public db()
        {
            string cnnstr = string.Format("Data Source={0};Version=3;New=False;", HttpContext.Current.Server.MapPath("~\\Data\\example.sqlite"));
            sql_con = new SQLiteConnection(cnnstr);
        }

        protected void ExecuteQuery(string txtQuery)
        {
            sql_con.Open();
            sql_cmd = sql_con.CreateCommand();
            sql_cmd.CommandText = txtQuery;
            sql_cmd.ExecuteNonQuery();
            sql_con.Close();
        }
    }
}